/**
 * Created by 白雨浓 on 2019/1/16 16:07.
 */
import convert2Ast from "./convert2Ast";

const toInput = (ast) => {
  let temp = '';

  ast.items.forEach(item => {
    temp += `<el-form-item label="${item.annotation}：" prop="${item.field}">
    <el-input class="input" v-model.trim="{REPLACE}.${item.field}"></el-input>
</el-form-item>\n`;
  });

  return temp;
};

export default (entity) => {
  return toInput(convert2Ast(entity));
}
